package com.huawang.mdesign.model.service.util.reqif;

import com.huawang.mdesign.model.service.util.reqif.converter.DateConverter;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * Abstract base class providing an identification concept for ReqIF elements.
 *
 * @author xdl
 * @since 2023-04-04
 */
@Getter
@Setter
public class Identifiable {

    /**
     * Optional additional description for the information element.
     */
    @XStreamAlias(ReqIFConstants.DESC)
    @XStreamAsAttribute
    private String desc;

    /**
     * The lifetime immutable identifier for an instance of a ReqIF information type.
     */
    @XStreamAlias(ReqIFConstants.IDENTIFIER)
    @XStreamAsAttribute
    private String identifier;

    /**
     * The date and time of the last change of the information element.
     */
    @XStreamAlias(ReqIFConstants.LAST_CHANGE)
    @XStreamAsAttribute
    @XStreamConverter(DateConverter.class)
    private Date lastChange;

    /**
     * The human-readable name for the information element.
     */
    @XStreamAlias(ReqIFConstants.LONG_NAME)
    @XStreamAsAttribute
    private String longName;

    @XStreamAlias(ReqIFConstants.ALTERNATIVE_ID)
    private AlternativeID alternativeID;
}
